﻿namespace SERFLITEMAX20.Test
{
    using SERFLITEMAX20.Core;
    using System;
    using System.Collections;
    using System.Diagnostics;
    using System.Threading;

    internal class Program
    {
        private static void Main(string[] args)
        {
            SERFLITEMAX20.Core.Main main = new SERFLITEMAX20.Core.Main();
            Console.WriteLine("waiting for wow");
            while (Process.GetProcessesByName("WoW").Length == 0)
            {
                if (Console.ReadKey(true).Key == ConsoleKey.Escape)
                {
                    return;
                }
            }
            Console.WriteLine("wow found now starting");
            if (main.StartFishing())
            {
                Console.WriteLine("Lite started");
                long guid = 0L;
                long num2 = 0L;
                Hashtable hashtable = new Hashtable();
                SortedList list = null;
                while (true)
                {
                    if ((main.Player != null) && (guid != main.Player.Guid))
                    {
                        Console.WriteLine("Player GUID: " + main.Player.Guid.ToString());
                        guid = main.Player.Guid;
                    }
                    if (main.BobberValid)
                    {
                        int num4;
                        if (num2 != main.Bobber.Guid)
                        {
                            Console.WriteLine("Bobber GUID: " + main.Bobber.Guid.ToString());
                            num2 = main.Bobber.Guid;
                            list = new SortedList();
                            for (num4 = 180; num4 < 190; num4++)
                            {
                                hashtable[num4] = main.Bobber.ReadPtrBaseByte(num4);
                                Console.WriteLine("Bobber watch INIT:  index: " + num4.ToString() + " value: " + hashtable[num4].ToString());
                            }
                        }
                        for (num4 = 180; num4 < 190; num4++)
                        {
                            if (((byte) hashtable[num4]) != main.Bobber.ReadPtrBaseByte(num4))
                            {
                                hashtable[num4] = main.Bobber.ReadPtrBaseByte(num4);
                                Console.WriteLine("Bobber watch:  index: " + num4.ToString() + " value: " + hashtable[num4].ToString());
                            }
                        }
                    }
                    Thread.Sleep(0x7d);
                }
            }
        }
    }
}

